package com.zwq.springbootlearn.util;

import com.zwq.springbootlearn.model.Result;

/**
 * @Author: zwq
 * Create in 2018/6/30 16:40
 */
public class ResultUtil {

    public static Result success(Object obj){
        Result result = new Result();
        result.setCode(0);
        result.setMsg("成功");
        result.setData(obj);

        return result;
    }

    public static Result success(){
        return success(null);
    }

    public static Result error(Integer code,String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMsg(msg);
        result.setData(null);

        return result;
    }
}
